import {createRouter, createWebHistory, useRouter} from "vue-router";
import Login from '@/views/Login.vue'
import Home from '@/views/Home.vue'

import Message from '@/views/components/Message.vue'
import Record from '@/views/components/Record.vue'
import Update from '@/views/components/Update.vue'
import GL from '@/views/components/GL.vue'


const router = createRouter({
    history: createWebHistory(),
    routes: [
        {   path: '/',
            redirect: "/login",
        },
        {
            path: '/login',
            component: Login
        },
        {
            path: '/home',
            component: Home,
            meta: {isKeepalive: true},
            children: [
                {
                    path: 'gl',
                    name: 'gl',
                    meta: {isKeepalive: true},
                    component: GL,

                },
                {
                    path: 'message',
                    name: 'mess',
                    component: Message
                },
                {
                    path: 'record',
                    component: Record
                },
                {
                    path: 'update',
                    component: Update
                }
            ]
        }
    ]
})

export default router